package com.mnb.base.controller;

import com.mnb.base.entity.CusDuty;
import com.mnb.base.entity.SysUser;
import com.mnb.base.service.CusDutyService;
import com.mnb.base.service.impl.CusDutyServiceImpl;
import com.mnb.common.utils.R;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (cus_duty)表控制层
 *
 * @author xxxxx
 */
@RestController
@RequestMapping("/cus_duty")
public class CusDutyController {
    /**
     * 服务对象
     */
    @Resource
    private CusDutyService cusDutyService;


    @RequestMapping("/getList")
    public R getList(CusDuty cusDuty) {
        return cusDutyService.getList(cusDuty);
    }

    @RequestMapping("/getDayList")
    public R getDayList(CusDuty cusDuty) {
        return cusDutyService.getDayList(cusDuty);
    }

    @RequestMapping("/insert")
    public R insert(@RequestBody CusDuty cusDuty) {
        return cusDutyService.insert(cusDuty);
    }

    @RequestMapping("/update")
    public R update(@RequestBody CusDuty cusDuty) {
        return cusDutyService.update(cusDuty);
    }

    @RequestMapping("/delete")
    public R delete(Long id) {
        cusDutyService.deleteByPrimaryKey(id);
        return R.ok();
    }

}
